//
//  ViewControllerNew1.m
//  ProjectTest
//
//  Created by User on 2017/10/12.
//  Copyright © 2017年 User. All rights reserved.
//

#import "ViewControllerNew1.h"
#import "ViewControllerNew2.h"

@interface ViewControllerNew1 () <ViewControllerDelegate>

@end

@implementation ViewControllerNew1

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"1";
    self.view.backgroundColor = [UIColor whiteColor];
    
    Class c = [ViewControllerNew2 class];
    NSLog(@"c === %@",c);
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)push:(id)sender {
    ViewControllerNew2 *vc2 = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"ViewControllerNew2"];
    vc2.delegate = self;
    vc2.string = self.textField.text;
    
    __weak typeof(self) weakSelf = self;
    [vc2 dataBlock:^(NSString *backString) {
        weakSelf.textField.text = backString;
    }];
    
    [self.navigationController pushViewController:vc2 animated:YES];
}

- (void)comeBack:(NSString *)string
{
    self.textField.text = string;
    NSLog(@"%@",string);
}



/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (IBAction)textField1:(id)sender {
}
@end
